<div class="tabbable tabs-left">
              <ul class="nav nav-tabs">
              	<li><h5><?php echo $this->translate('在线客户组'); ?></h5></li>
                <li class="active"><a data-toggle="tab" href="#express_a"><?php echo $this->translate('基本信息'); ?></a></li>
              </ul>
              <form class="form-horizontal" name="online_group_form" id="online_group_form" method="post" action="">
              <input type="hidden" name="online_group_id" id="online_group_id" value="<?php if($this->online_group_info) echo $this->online_group_info->online_group_id; else echo ''; ?>" />
              <div class="tab-content">
    			<div id="sticky_navigation" style="height:30px;border-bottom:4px solid #DFDFDF;">
        			<div class="pull-left" style="font-size:16px;line-height:30px;"><strong><?php if($this->online_group_info) echo $this->translate('编辑'); else echo $this->translate('新加'); ?><?php echo $this->translate('客户组'); ?></strong></div>
        			<div class="pull-right">
                	<a href="<?php echo $this->url('online/default', array('action'=>'group')); ?>" class="btn btn-small"><i class="icon-arrow-left"></i> <?php echo $this->translate('返回客服组列表'); ?></a>&nbsp;
                	<a href="<?php echo $this->serverUrl(true); ?>" class="btn btn-small btn-warning"><i class="icon-repeat icon-white"></i> <?php echo $this->translate('刷新'); ?></a>&nbsp;
                    <?php if($this->online_group_info) { ?>
                    <a href="javascript:;" onclick="return online_group_del_js(<?php echo $this->online_group_info->online_group_id ?>);" class="btn btn-small btn-danger"><i class="icon-remove icon-white"></i> <?php echo $this->translate('删除客户组'); ?></a>&nbsp;
                    <?php } ?>
                	<button type="submit" class="btn btn-small btn-primary"><i class="icon-ok icon-white"></i> <?php echo $this->translate('保存客户组信息'); ?></button>&nbsp;
<!--                	<a href="--><?php //echo $this->myviewalias()->dbshopHelpUrl('online_group_set'); ?><!--" target="_blank" class="btn btn-small btn-info"><i class="icon-info-sign icon-white"></i> --><?php //echo $this->translate('查看帮助说明'); ?><!--</a>-->
                	</div>
        		</div>
                <div id="express_a" class="tab-pane active">
                	<div class="well admin_add_header_well"><?php echo $this->translate('基本信息'); ?></div>
                	<div class="well admin_add_well"> 
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('客服组名称'); ?><span class="must_add_value">*</span>：</label>
           					<div class="controls">
              					<input type="text" id="online_group_name"  name="online_group_name" class="span6" value="<?php echo ($this->online_group_info ? $this->escapeHtml($this->online_group_info->online_group_name) : ''); ?>">
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('显示位置'); ?>：</label>
           					<div class="controls">
              					<label class="checkbox inline"><input type="checkbox" id="index_show" name="index_show" <?php if($this->online_group_info and $this->online_group_info->index_show == 'true') echo 'checked="checked"'; ?> value="true" /><?php echo $this->translate('首页'); ?></label>
                                <label class="checkbox inline"><input type="checkbox" id="class_show" name="class_show" <?php if($this->online_group_info and $this->online_group_info->class_show == 'true') echo 'checked="checked"'; ?> value="true" /><?php echo $this->translate('商品列表页'); ?></label>
                                <label class="checkbox inline"><input type="checkbox" id="goods_show" name="goods_show" <?php if($this->online_group_info and $this->online_group_info->goods_show == 'true') echo 'checked="checked"'; ?> value="true" /><?php echo $this->translate('商品内容页'); ?></label>
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('客户组排序'); ?><span class="must_add_value">*</span>：</label>
           					<div class="controls">
              					<input type="text" class="span1" name="online_group_sort" id="online_group_sort" value="<?php echo ($this->online_group_info ? $this->online_group_info->online_group_sort : 255); ?>" />
            				</div>                        
                        </div>
                    	<div class="control-group">
                  			<label for="input01" class="control-label"><?php echo $this->translate('客服组状态'); ?><span class="must_add_value">*</span>：</label>
           					<div class="controls">
              					<label class="radio inline"><input type="radio" value="1" <?php if(($this->online_group_info and $this->online_group_info->online_group_state == 1) or !$this->online_group_info) echo 'checked="checked"'; ?> name="online_group_state"><?php echo $this->translate('启用'); ?></label>
                                <label class="radio inline"><input type="radio" value="0" <?php if($this->online_group_info and $this->online_group_info->online_group_state == 0) echo 'checked="checked"'; ?> name="online_group_state"><?php echo $this->translate('禁用'); ?></label> 
            				</div>                        
                        </div>                                                                                                                                               
                  	</div>
                </div>
                                
                
             </div>
              </form>
</div>
<script>
$(document).ready(function() {
	$("#online_group_form").validate({
		rules: {
			online_group_name: {
				required: true,
				maxlength:60
			},
			online_group_sort: {
				required: true,
				number: true,
				min:1,
				max:255
			}
		},
		messages: {
			online_group_name: {
				required: "<?php echo $this->translate('客服组名称不能为空！'); ?>",
				maxlength: "<?php echo $this->translate('客服组名称最多输入30个汉字！'); ?>"
			},
			online_group_sort: {
				required: "<?php echo $this->translate('客服组排序不能为空！'); ?>",
				number: "<?php echo $this->translate('客服组排序必须为数字！'); ?>",
				min: "<?php echo $this->translate('客服组排序最小为1！'); ?>",
				max: "<?php echo $this->translate('客服组排序最大为255！'); ?>"
			}
		}
	});
});

//客服组删除js
function online_group_del_js(online_group_id) {
	if(window.confirm('<?php echo $this->translate('您确实要删除该客服组吗？'); ?>')) {
	$.post("<?php echo $this->url('online/default', array('action'=>'groupdel')); ?>",{online_group_id:online_group_id},
	function(data){
		if(data != 'false') {
			if(data == 'online_exists') {
				alert('<?php echo $this->translate('该客服组已经使用，不能删除！'); ?>');
				return false;	
			}
			window.location.href='<?php echo $this->url('online/default', array('action'=>'group')); ?>';
			return true;
		} else {
			alert('<?php echo $this->translate('客服组删除失败！'); ?>');
		}
	});
	}
	return false;
}
</script>